﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.Md32StakeholderAddEdit.created = function (screen) {
    // Write code here.
    if (screen.tbStakeholder.LastName == undefined && screen.tbStakeholder.FirstName == undefined) {
        screen.details.displayName = 'Neues Mitglied';
    }
    else
        screen.details.displayName = screen.tbStakeholder.FirstName + ' ' + screen.tbStakeholder.LastName;
};
myapp.Md32StakeholderAddEdit.Delete_execute = function (screen) {
    // Write code here.
    screen.tbStakeholder.IsDeleted = true;
    return myapp.commitChanges().then(null, function fail(e) {
        myapp.cancelChanges();
        throw e;
    });

};